const TokenKey = 'mo_token'
const TokenExpiredKey = 'mo_token_expired_time'
const UserIdKey = 'mo_user_id'

export function getToken() {
  return localStorage.getItem(TokenKey)
}

export function setToken(token) {
  return localStorage.setItem(TokenKey, token)
}

export function removeToken() {
  return localStorage.removeItem(TokenKey)
}

export function getExpiredTime() {
  return localStorage.getItem(TokenExpiredKey) || 0
}

export function setExpiredTime(time) {
  return localStorage.setItem(TokenExpiredKey, time)
}

export function removeExpiredTime() {
  return localStorage.removeItem(TokenExpiredKey)
}

export function getUserId() {
  return localStorage.getItem(UserIdKey)
}

export function setUserId(token) {
  return localStorage.setItem(UserIdKey, token)
}

export function removeUserId() {
  return localStorage.removeItem(UserIdKey)
}
